'''
用来显示相关数据的
'''

import matplotlib.pyplot as plt

class Plot:
    def __init__(self):
        self.x = []
        self.y = []
        # 设置图表的标题和坐标轴标签
        plt.title('Example Line Plot')
        plt.xlabel('X Axis')
        plt.ylabel('Y Axis')

    def show(self):
        if len(self.x)!=len(self.y):
            self.x = [i for i in range(len(self.y))]
        plt.plot(self.x, self.y)
        plt.show()
    
    def update(self):
        plt.clf()
        self.show()